package com.taijihuabao.modules.controller;

import com.taijihuabao.common.jsonresult.JsonResult;
import com.taijihuabao.modules.model.resendmessage.dto.ResendMessageCrDTO;
import com.taijihuabao.modules.service.ResendMessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 消息重发
 *
 * @author Tu
 * @date 2021/12/23 15:56
 */
@Api(tags = "消息重发")
@RestController
@RequestMapping("/api/v1/resendMessage")
public class ResendMessageController {

    @Resource
    private ResendMessageService resendMessageService;

    /**
     * 消息列表
     *
     * @return
     */
    @ApiOperation("消息列表")
    @GetMapping
    public JsonResult selResendMessageList() {
        return JsonResult.success(resendMessageService.selResendMessageList());
    }

    /**
     * 消息重发
     *
     * @return
     */
    @ApiOperation("消息重发")
    @PostMapping
    public JsonResult resendMessage(@RequestBody ResendMessageCrDTO resendMessageCrDTO) {
        resendMessageService.resendMessage(resendMessageCrDTO);
        return JsonResult.success();
    }

}
